<?php 

include '../function.php';
// 连接数据库
$link = @new mysqli("localhost","root","","student");

// var_dump($link);
if ($link->connect_errno) {
	echo "链接失败：代码".$link->connect_errno."<br>"."错误信息：".$link->connect_error;exit;
}

// 设置编码
$link->query("SET NAMES 'utf8'");


// $id = $_GET['id'];

$sql = "select * from students ";

$result = $link->query($sql);

// var_dump($result->fetch_assoc());
$arr = array();
while ($row = $result->fetch_assoc()) {
	$arr[] = $row;
}

var_dump($arr);

$result->free();
$link->close();








 ?>